-- GENERATED SPELL FOR [Malevolent Hatchling] --


function spell0_22337(pUnit, Event) --@Charge,n/a--
pUnit:FullCastSpellOnTarget(36140,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_22337', 658, 1)
end

function spell1_22337(pUnit, Event) --@Terrifying Screech,Self--
pUnit:FullCastSpellOnTarget(38021,pUnit)
pUnit:RegisterEvent('Sorts_22337', 7326, 1)
end

function Sorts_22337(pUnit, Event)
local choix_sorts_22337 = math.random(0, 1)
if choix_sorts_22337 == 0 then
pUnit:RegisterEvent('spell0_22337', 1, 1)
end
if choix_sorts_22337 == 1 then
pUnit:RegisterEvent('spell1_22337', 1, 1)
end
end

function mob22337_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_22337', math.random(1500, 3000), 1)
end

function mob22337_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22337_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob22337_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(22337, 1, 'mob22337_Action')
RegisterUnitEvent(22337, 2, 'mob22337_Leave')
RegisterUnitEvent(22337, 3, 'mob22337_Kill')
RegisterUnitEvent(22337, 4, 'mob22337_Die')
